import { actionTypes } from '../store';
import axios from 'axios';

const setData=(value)=>({
    type:actionTypes.GET_ARTICLE,
    value
});

export const getDetailInfo=(id)=>{
    return(dispatch)=>{
        axios.get('/api/detail.json?id='+id).then((res)=>{
            const data=res.data.data
            dispatch(setData(data))
            console.log(res)
        }).catch((err)=>{
                console.log(err)
        })
    }
};





